using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace MyExtensions
{
    public static class Extensions
    {
        public static float[] ToFloat(this OpenTK.Matrix4 m)
        {
            float[] f = new float[16];
            f[0] = m.Column0.X;
            f[1] = m.Column0.Y;
            f[2] = m.Column0.Z;
            f[3] = m.Column0.W;

            f[4] = m.Column1.X;
            f[5] = m.Column1.Y;
            f[6] = m.Column1.Z;
            f[7] = m.Column1.W;

            f[8] = m.Column2.X;
            f[9] = m.Column2.Y;
            f[10] = m.Column2.Z;
            f[11] = m.Column2.W;

            f[12] = m.Column3.X;
            f[13] = m.Column3.Y;
            f[14] = m.Column3.Z;
            f[15] = m.Column3.W;
            return f;
        }
        public static void FillRadialGradient(this Graphics g, int x, int y, int width, int height, PointF midPoint, Color CenterColor, Color[] Surroundings)
        {
            GraphicsPath gp = new GraphicsPath();
            gp.AddEllipse(x, y, width, height);

            PathGradientBrush pgb = new PathGradientBrush(gp);

            pgb.CenterPoint = midPoint;
            pgb.CenterColor = CenterColor;
            pgb.SurroundColors = Surroundings;

            g.FillPath(pgb, gp);
        }
    }
}
